Skip to content

Walk transparent ops when extracting input quant params (#20139)#20139

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
ethansfng:export-D107922730
Jun 11, 2026
Merged

Walk transparent ops when extracting input quant params (#20139)#20139
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
ethansfng:export-D107922730

Conversation

@ethansfng

@ethansfng ethansfng commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary:

SAM 3's encoder input feeds a transparent shape op first — placeholder → reshape (patchify) → quantize_per_tensor — whereas the original code only recognized placeholder → quantize_per_tensor (a quantize directly on the input). The change walks through transparent ops (reshape/permute/transpose/etc.) from the input to reach the first quantize, so that indirected pattern resolves.

Reviewed By: DrJessop

Differential Revision: D107922730

@pytorch-bot

pytorch-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20139

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 2795439 with merge base f0dff03 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 9, 2026
@meta-codesync

meta-codesync Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@ethansfng has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107922730.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Walk transparent ops when extracting input quant params Walk transparent ops when extracting input quant params (#20139) Jun 9, 2026
@ethansfng ethansfng force-pushed the export-D107922730 branch from e9b1f53 to 2304b88 Compare June 9, 2026 18:43
ethansfng added a commit to ethansfng/executorch that referenced this pull request Jun 9, 2026
Summary:

SAM 3's encoder input feeds a transparent shape op first — placeholder → reshape (patchify) → quantize_per_tensor — whereas the original code only recognized placeholder → quantize_per_tensor (a quantize directly on the input). The change walks through transparent ops (reshape/permute/transpose/etc.) from the input to reach the first quantize, so that indirected pattern resolves.

Differential Revision: D107922730
ethansfng added a commit to ethansfng/executorch that referenced this pull request Jun 9, 2026
Summary:

SAM 3's encoder input feeds a transparent shape op first — placeholder → reshape (patchify) → quantize_per_tensor — whereas the original code only recognized placeholder → quantize_per_tensor (a quantize directly on the input). The change walks through transparent ops (reshape/permute/transpose/etc.) from the input to reach the first quantize, so that indirected pattern resolves.

Differential Revision: D107922730
@ethansfng ethansfng force-pushed the export-D107922730 branch from 2304b88 to 710cea4 Compare June 9, 2026 22:10
Summary:

SAM 3's encoder input feeds a transparent shape op first — placeholder → reshape (patchify) → quantize_per_tensor — whereas the original code only recognized placeholder → quantize_per_tensor (a quantize directly on the input). The change walks through transparent ops (reshape/permute/transpose/etc.) from the input to reach the first quantize, so that indirected pattern resolves.

Reviewed By: DrJessop

Differential Revision: D107922730
@ethansfng ethansfng force-pushed the export-D107922730 branch from 710cea4 to 2795439 Compare June 10, 2026 20:28
@meta-codesync meta-codesync Bot merged commit 27cc7e8 into pytorch:main Jun 11, 2026
179 of 182 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants